package navigation

import android.view.View
import androidx.navigation.Navigator
import androidx.navigation.fragment.FragmentNavigator
import androidx.navigation.fragment.NavHostFragment
import com.sqsxblog.navigation.R


class ReusingHost : NavHostFragment() {


    override fun createFragmentNavigator(): Navigator<out FragmentNavigator.Destination> {
        val containerId = if (id != 0 && id != View.NO_ID) {
            id
        } else R.id.nav_host_fragment_container

        return ReusingFragmentNavigator(
            requireContext(), childFragmentManager,
            containerId
        )
    }


}